class CQueue {
    public Stack<Integer> s1;
    public Stack<Integer> s2;

    public CQueue() {
        s1 = new Stack<>();
        s2 = new Stack<>();
    }
    
    public void appendTail(int value) {
        s1.push(value);
    }
    
    public int deleteHead() {
        while(!s1.isEmpty()) {
            s2.push(s1.pop());
        }
        
        if(s2.isEmpty()) {
            return -1;
        }
        int ret = s2.pop();
        while(!s2.isEmpty()) {
            s1.push(s2.pop());
        }
        return ret;
    }
}

/**
 * Your CQueue object will be instantiated and called as such:
 * CQueue obj = new CQueue();
 * obj.appendTail(value);
 * int param_2 = obj.deleteHead();
 */